﻿using PLCS.Application.Contracts.MenuApp.Dtos;

namespace PLCS.App.UserAuthorization.Converts;

public class MenuChildrenConvert : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
        if (!(value is List<MenuDto> list))
        {
            return null;
        }

        return string.Join(ConstantChar.SplitChar, list.Select(menu => menu.Title));
    }

    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
    {
        return null;
    }
}